package com.enerccio.commonJ.objects;

public final class Condition extends commonJObject {
	
	public class ConditionException extends Exception{

		private static final long serialVersionUID = 5008603472951315491L;
		
		private Condition cause;

		public ConditionException(Condition cause){
			this.cause = cause;
		}
		
		public Condition getCondition(){
			return cause;
		}
		
		@Override
		public String getMessage(){
			return cause.toString();
		}
	}

	private Object tag;
	
	public Condition(Object object) throws ConditionException {
		this.tag = object;
		throw new ConditionException(this);
	}
	
	public synchronized Object getTag(){
		return tag;
	}

}
